﻿// -------------------------------------------------------------------------------------------------------------------------------
// <copyright file="CMFlattenDenseCloneableMatrixOperationsProvider.cs" company="Exul">
//     Copyright (c) Exul. All rights reserved.
// </copyright>
// <author>
//     Exul
// </author>
// -------------------------------------------------------------------------------------------------------------------------------

namespace ExulLibrary.Mathematics.LinearAlgebra.Sequential
{
    #region Usings

    using System;

    #endregion

    /// <summary>
    ///     Provides operations for <see cref="CMFlattenDenseMatrix{T}"/> through interface.
    /// </summary>
    internal sealed class CMFlattenDenseCloneableMatrixOperationsProvider : ICloneableMatrixOperationsProvider
    {
        #region Implemented Interfaces

        #region ICloneableMatrixOperationsProvider

        /// <summary>
        ///     Creates a deep copy of the matrix.
        /// </summary>
        /// <typeparam name="T">
        ///     The type of values of matrix elements.
        /// </typeparam>
        /// <param name="source">
        ///     The source matrix.
        /// </param>
        /// <returns>
        ///     A deep copy of the matrix.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="source"/> is <see langword="null"/>.
        /// </exception>
        public Matrix<T> Clone<T>(Matrix<T> source)
        {
            var realMatrix = source as CMFlattenDenseMatrix<T>;
            return realMatrix.Clone();
        }

        #endregion

        #endregion
    }
}